import 'package:flutter/material.dart';

class MyTabView extends StatefulWidget{
  @override
  MyTabViewState createState() {
    // TODO: implement createState
    return MyTabViewState();
  }
}
class MyTabViewState extends State<MyTabView>{
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return MaterialApp(
      theme: ThemeData(
        splashColor: Colors.transparent,
        highlightColor: Colors.transparent
      ),
      home: DefaultTabController(
        length: 3,
        child: Scaffold(
          appBar: AppBar(
            title: Text("Tab滑动标签"),
            leading: IconButton(icon: Icon(Icons.arrow_back),onPressed: (){Navigator.pop(context);},),
            bottom: TabBar(
              indicatorSize: TabBarIndicatorSize.label,
              unselectedLabelColor: Colors.black12,
              tabs: <Widget>[
                Tab(
                  icon: Icon(Icons.directions_bus),
                ),
                Tab(
                  icon: Icon(Icons.local_taxi),
                ),
                Tab(
                  icon: Icon(Icons.directions_walk),
                ),
              ],
            ),
          ),
          body: TabBarView(
            children: <Widget>[
              Center(child: Icon(Icons.directions_bus),),
              Center(child: Icon(Icons.local_taxi),),
              Center(child: Icon(Icons.directions_walk),),
            ],
          ),
        ),
      ),
    );
  }
}